from sys import path
import os.path
from glob import glob

db = {}

def found(p):
   base, fname = os.path.split(p)
   if '.' not in fname:
      print 'ignore', base, fname
      return
   db.setdefault(base, set()).add(fname)
   
for p in path:
   if '.egg' in p:
      found(p)
   for f in glob('%s/*' % p):
      if '.egg' in f:
         found(f)

for key in sorted(db.keys()):
   print '\n',key
   for f in sorted(db[key]):
      print '\t'.join([name.ljust(20) for name in f.split('-',2)])

